package com.itheima.stock.mapper;

import com.itheima.stock.common.domian.InnerMarketDomain;
import com.itheima.stock.pojo.StockMarketIndexInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 久思
* @description 针对表【stock_market_index_info(股票大盘数据详情表)】的数据库操作Mapper
* @createDate 2023-09-24 15:22:07
* @Entity com.heima.stock.pojos.StockMarketIndexInfo
*/
@Mapper
public interface StockMarketIndexInfoMapper {
    List<InnerMarketDomain> innerIndexAll(@Param("ids") List<String> inner,
                                          @Param("lastDate") Date date);

    /**
     * 根据指定时间和大盘id查询T日和T-1日的成交量
     * @param marketIds
     * @param startTime
     * @param endTime
     * @return
     */
    List<Map> getStockTradeVol(@Param("marketIds") List<String> marketIds,
                               @Param("startTime") Date startTime,
                               @Param("endTime") Date endTime);

    /**
     * 批量插入股票大盘数据
     * @param infos
     */
    int insertBatch(@Param("list") List<StockMarketIndexInfo> infos);

    /**
     * 根据指定日期和大盘id查询数据
     *
     * @param innerIds
     * @param lastTime
     * @return
     */
    List<Map<String, Object>> getInnerExternalInfo(@Param("ids") List<String> innerIds,
                                                   @Param("lastTime") Date lastTime);
}
